package com.mi.soul.whale.module.system.controller;

import com.mi.rule.resource.ResC;
import com.mi.rule.resource.ResM;
import com.mi.rule.util.project.SRS;
import com.mi.soul.whale.module.system.service.impl.SystemServiceImpl;
import com.mi.soul.whale.mybatis.entity.SysRole;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@ResC(value = "角色管理", parent = "系统管理")
@RestController
@RequestMapping("/system/role")
public class RoleController {
    @Autowired
    SystemServiceImpl systemService;

    @ResM("添加数据")
    @RequestMapping({"/insert"})
    public SRS insert(@RequestBody SysRole role) {
        return systemService.insertSysRole(role);
    }


    @ResM("删除数据")
    @RequestMapping({"/delete"})
    public SRS delete(@RequestBody Object[] ids) {
        return systemService.deleteSysRole(ids);
    }


    @ResM("修改数据")
    @RequestMapping({"/update"})
    public SRS update(@RequestBody SysRole role) {
        return systemService.updateSysRole(role);
    }


    @ResM("列表查询")
    @RequestMapping({"/list"})
    public SRS list(@RequestBody SRS param) {
        return systemService.listSysRole(param);
    }


    @ResM("分页查询")
    @RequestMapping("/page")
    public SRS page(@RequestBody SRS param) {
        return systemService.pageSysRole(param);
    }


    @ResM("详情查询")
    @RequestMapping("/info")
    public SRS one(@RequestBody SRS param) {
        return systemService.infoSysRole(param);
    }


//    @ResM("获取全部菜单和资源", author = "王永吉")
//    @RequestMapping(value = "/allMenuResource")
//    public SRS allMenuResource(@RequestBody SRS param) throws Exception {
//        return systemService.allMenuResource(param);
//    }
//
//
//    @ResM("查询全部角色", author = "王永吉")
//    @RequestMapping(value = "/allRole")
//    public SRS allRole(@RequestBody SRS param) throws Exception {
//        return systemService.allRole(param);
//    }


}
